import { useUserStoreWithOut as useUserStore } from "@/store/modules/user";

export default function usePermissionAuth(){
    const userStore = useUserStore()
    const userInfo = userStore.getUserInfo
    const hasAuth = (roles: number[]):boolean =>{
        // 拿取path获取name
        let pass = false;
        // 没有权限列表
        if (roles.findIndex((item)=>item === userInfo?.role) !== -1){
            pass = true
        }
        return pass
    }
    return{
        hasAuth
    }
}